unit Settings_Colors;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, StdCtrls, header, Buttons, ExtCtrls;

type
  TSet_Colors = class(TFrame)
    ColorDialog1: TColorDialog;
    GroupBox: TGroupBox;
    Button1: TButton;
    Shape1: TShape;
    Shape2: TShape;
    Button2: TButton;
    Shape3: TShape;
    Button3: TButton;
    Shape4: TShape;
    Button4: TButton;
    Shape5: TShape;
    Button5: TButton;
    Button6: TButton;
    Shape6: TShape;
    ComboBox1: TComboBox;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
  private
    colors: TSkin;
    procedure Colorize;
  public
    procedure Init;
    procedure Apply;
  end;

implementation

uses unit1;

{$R *.dfm}

{ TSet_Colors }

procedure TSet_Colors.Apply;
begin
  Form1.CS.Skin := colors;
  Form1.TntStringGrid1.Repaint;
end;

procedure TSet_Colors.Button1Click(Sender: TObject);
begin
  ColorDialog1.Color := colors.listbgcolor1;

  if ColorDialog1.Execute then
    colors.listbgcolor1 := ColorDialog1.Color;

  Colorize;
end;

procedure TSet_Colors.Button2Click(Sender: TObject);
begin
  ColorDialog1.Color := colors.listbgcolor2;

  if ColorDialog1.Execute then
    colors.listbgcolor2 := ColorDialog1.Color;

  Colorize;
end;

procedure TSet_Colors.Button3Click(Sender: TObject);
begin
  ColorDialog1.Color := colors.listfontcolor;

  if ColorDialog1.Execute then
    colors.listfontcolor := ColorDialog1.Color;

  Colorize;
end;

procedure TSet_Colors.Button4Click(Sender: TObject);
begin
  ColorDialog1.Color := colors.listactivecolor;

  if ColorDialog1.Execute then
    colors.listactivecolor := ColorDialog1.Color;

  Colorize;
end;

procedure TSet_Colors.Button5Click(Sender: TObject);
begin
  ColorDialog1.Color := colors.listselfontcolor;

  if ColorDialog1.Execute then
    colors.listselfontcolor := ColorDialog1.Color;

  Colorize;
end;

procedure TSet_Colors.Button6Click(Sender: TObject);
begin
  ColorDialog1.Color := colors.listselbgcolor;

  if ColorDialog1.Execute then
    colors.listselbgcolor := ColorDialog1.Color;

  Colorize;
end;

procedure TSet_Colors.Colorize;
begin
  Shape1.Brush.Color := colors.listbgcolor1;
  Shape2.Brush.Color := colors.listbgcolor2;
  Shape3.Brush.Color := colors.listfontcolor;
  Shape4.Brush.Color := colors.listactivecolor;
  Shape5.Brush.Color := colors.listselfontcolor;
  Shape6.Brush.Color := colors.listselbgcolor;
end;

procedure TSet_Colors.Init;
begin
  colors := Form1.CS.Skin;
  Colorize;
end;


end.
